<?php namespace Home\Controller;
use Hdphp\Controller\Controller;
//前台注册控制器
class RegisterController extends Controller{
	protected $model;
	public function __init(){
		//实例化user模型
		$this->model = new \Common\Model\User;
	}
	//注册
	public function index(){
		if(IS_POST){
			if($this->model->store()){
				//跳转到登录页
				go(U('Login/index'));
			}
			View::error($this->model->getError());
		}
        View::make();
	}
	//验证码
	public function code(){
		Code::num('4')->fontColor('#006699')->make();
	}
}

 ?>